package com.demo.zhihu.model;

import java.text.ParseException;
import java.util.Date;

public class Comment {
	private int id;
	//要回答的问题id
    private int target;
    //要回答目标的类型 0->对帖子进行评论   1->对评论进行评论
    private int type;
    //发表评论的时间
    private Date date;
    //评论用户id
    private int commenter;
    //回答内容
    private String content;
    private int likes;
    public static final int ME = 1;
    
    public Comment() {}
    public Comment(int type,int target,int commenter,String content) {
    	this.type = type;
    	this.target = target;
    	java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    	try {
			this.date = sdf.parse(sdf.format(new Date()));
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	this.commenter = commenter;
    	this.content = content;
    }
    // Getter and Setter for id
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    // Getter and Setter for target
    public int getTarget() {
        return target;
    }

    public void setTarget(int target) {
        this.target = target;
    }

    // Getter and Setter for type
    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    // Getter and Setter for date
    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    // Getter and Setter for commenter
    public int getCommenter() {
        return commenter;
    }

    public void setCommenter(int commenter) {
        this.commenter = commenter;
    }

    // Getter and Setter for content
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    // Getter and Setter for likes
    public int getLikes() {
        return likes;
    }

    public void setLikes(int likes) {
        this.likes = likes;
    }
}
